﻿using System;
using System.Linq;



class MaxSumSequence
{
    static void Main()
    {
        int[] array; //{ 3, 2, 3, 4, 2, 2, 4 };
        int n = int.Parse(Console.ReadLine());
        array = new int[n];

        int k = int.Parse(Console.ReadLine());
        
        int maxSum = 0;


        for (int counter = 0; counter < n; counter++)
        {
            array[counter] = int.Parse(Console.ReadLine());
        }

        for (int counter = 0; counter < array.Length-k; counter++)
        {
            int tempSum = 0;
            for (int i = counter; i < counter + k; i++)
            {
                tempSum += array[i];
            }

            if (tempSum > maxSum)
            {
                maxSum = tempSum;
            }
        }

        Console.WriteLine(maxSum);
    }
}

